package com.crizzbe.storeManage.Controller;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.crizzbe.storeManage.entity.Buyer;
import com.crizzbe.storeManage.entity.Employee;
import com.crizzbe.storeManage.entity.User;
import com.crizzbe.storeManage.mapper.BuyerMapper;
import com.crizzbe.storeManage.mapper.EmployeeMapper;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author Crizzbe
 * @since 2021-06-22
 */
@RestController
@CrossOrigin
@RequestMapping("/StoreManage/employee")
public class EmployeeController {
	@Autowired
	private EmployeeMapper employee;
	@GetMapping("/")
	 List<Employee> index() {
		 return employee.selectList(null);
	 }
	@PostMapping("/add")
	public void add(@RequestBody Employee parm) {
		employee.insert(parm);
	}
	@PostMapping("/delete")
	public void deleteData(@RequestBody Employee parm) {
		employee.deleteById(parm.Id);
	}
@PostMapping("/update")
	
	public void update(@RequestBody Employee form) {
	employee.updateById(form);
	}
}

